package com.gmu.service.impl;

import com.gmu.domain.ResResult;
import com.gmu.pojo.TblStudent;
import com.gmu.mapper.TblStudentMapper;
import com.gmu.pojo.TblUser;
import com.gmu.service.TblStudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 学生信息 服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-07-24
 */
@Service
public class TblStudentServiceImpl extends ServiceImpl<TblStudentMapper, TblStudent> implements TblStudentService {

    @Autowired
    private TblStudentMapper tblStudentMapper;
    //PC端搜索
    @Override
    public ResResult<?> getTblStudentByCondition(TblStudent tblStudent){
        String idNumber = tblStudent.getIdNumber();
        String name = tblStudent.getName();
        String telephone = tblStudent.getTelephone();
        String grade = tblStudent.getGrade();
        String major = tblStudent.getMajor();
        Integer volunteer = tblStudent.getVolunteer();
        String academy = tblStudent.getAcademy();

            List<TblStudent> tblStudents = tblStudentMapper.getStudentByCondition(name, telephone, idNumber,academy,grade,major,volunteer);
            return new ResResult<>(200,tblStudents);

    }
}
